import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import home from '../views/home'
import Category from '../views/Category'
import GoodsDetail from '@/components/goodsDetails/GoodsDetail'
import Cart from '@/views/Cart'
import login from '@/views/login'
import my from '@/components/my/my'
import pay from '@/components/pay/pay'
import address from '../views/address'
import AddAddress from '../views/add_address'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:{name: 'home'}
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      meta:{
        requireAuth: false
      }
    },
    {
      path: '/goodsDetail',
      name: 'goodsDetail',
      component: GoodsDetail,
      meta:{
        requireAuth: false
      }
    },
    {
      path: '/category',
      name: 'category',
      component: Category,
      meta:{
        requireAuth: false
      }
    }
    ,
    {
      path: '/cart',
      name: 'cart',
      component: Cart,
      meta:{
        requireAuth: true
      }
    },
    {
      path: '/login',
      name: 'login',
      component: login,
      meta:{
        requireAuth: false
      }
    }
    ,
    {
      path: '/my',
      name: 'my',
      component: my,
      meta:{
        requireAuth: false
      }
    } ,
    {
      path: '/pay',
      name: 'pay',
      component: pay,
      meta:{
        requireAuth: false
      }
    }
    ,
    {
      path: '/address',
      name: 'address',
      component: address,
      meta:{
        requireAuth: false
      }
    } ,
    {
      path: '/add_address',
      name: 'AddAddress',
      component: AddAddress,
      meta:{
        requireAuth: false
      }
    }
  ]
})
